1. Field of the Invention
The present invention relates to an image measurement device, and more specifically to improvement in an image measurement device that extracts an edge in a workpiece image obtained by photographing a workpiece, to measure a dimension of the workpiece.
2. Description of Related Art
An image measurement device is a device that photographs a workpiece to acquire a workpiece image and extracts an edge in the workpiece image to measure a dimension and a shape of the workpiece (e.g., JP 2012-32224 A, JP 2012-32341 A, JP 2012-32344 A, JP 2012-159409 A, and JP 2012-159410 A). Normally, the workpiece is placed on a movable stage that is movable in X-, Y-, and Z-axis directions. By moving the movable stage in the Z-axis direction, the workpiece image is brought into focus, and by moving the movable stage in the X- or Y-axis direction, a position of the workpiece is adjusted into a field of view.
Since the workpiece image is an extremely accurate analog of the workpiece irrespective of a position of the movable stage in the Z-axis direction, determination of a distance and an angle on the workpiece image allows detection of an actual dimension on the workpiece. Edge extraction is performed by analyzing a change in luminance of the workpiece image, detecting edge points, and fitting a geometric figure such as a straight line, a circle, or an arc to the detected plurality of edge points, whereby an edge showing a boundary between the workpiece and a background, and roughness on the workpiece is obtained. The dimension of the workpiece is measured as a distance or an angle between the edges obtained in such a manner, or a central position or a diameter of a circular edge. Further, a difference (error) between the measured dimension value and a design value is compared as a tolerance, to perform quality determination.
In the case of measuring an outer shape of the workpiece by use of such an image measurement device, there is often used transmittance illumination for irradiating the workpiece on the stage with illumination light from the opposite side to a camera. In contrast, in the case of measuring a non-through hole, a step, and roughness on the workpiece, there is often used epi-illumination for irradiating the workpiece on the stage with illumination light from the same side as the camera.
In the conventional image measurement device, a texture on the workpiece surface, namely, a processing mark, a pattern or fine roughness, may be erroneously extracted as an edge in dimension measurement using the epi-illumination, and the dimension measurement is thus difficult to stabilize as compared to the case of using the transmittance illumination, which has been problematic. Especially, in the case of photographing the workpiece on the stage by use of a camera with a low photographing magnification, an edge cannot be stably extracted, which has been problematic. Normally, in the dimension measurement, a vertical plane, which is parallel to a photographing axis of the camera, is extracted as an edge. However, since the camera with a low photographing magnification has a large depth of field, even when the upper end of the vertical plane is initially brought into focus, the lower end of the vertical plane is also brought into focus. Hence, correct edge extraction has been difficult since it is influenced not only by a texture on the upper end of the vertical plane but also by a texture on the lower end of the vertical plane.